﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;

namespace _04.FindSubstring
{
    class FindSubstring
    {
        static void Main(string[] args)
        {

            string text = "We are living in an yellow submarine." +
                          "We don't have anything else. Inside the submarine is very tight." +
                          "So we are drinking all the day. We will move out of it in 5 days.";
            string keyword = "in";
            text = text.ToLower();
            int index = text.IndexOf(keyword);
            int count = 0;
            while (index != -1)
            {
                index = text.IndexOf(keyword, index + 1);
                count++;
            }
            Console.WriteLine(count);
        }
    }
}
